/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Admin
 * Date: 2022-11-11
 * Time: 19:50
 */
import java.util.*;
import java.math.*;

public class Demo2 {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        while(scan.hasNextInt()) {
            long n = scan.nextInt();
            if(n == 0 ) break;

            System.out.print((long)Math.pow(5,n) - 4 + " ");
            System.out.print((long)Math.pow(4,n) + n - 4);
            System.out.println();
        }
    }
}
